package com.rd.teacher.jichao.day02.single;

public class Singleton1 {

    private Singleton1(){}

    private static Singleton1 instance;

    public static Singleton1 getInstance(){
        // 只有在第一次调用时被创建  后续调用直接返回
        if(instance == null){
            instance = new Singleton1();
        }
        return instance;
    }
}
